import java.util.Arrays;

class Solution {
    public void moveZeroes(int[] nums) {
        int people = 0;
        int dog = 0;
        while(dog < nums.length){
            if(nums[dog] != 0){
                nums[people] = nums[dog];
                people++;
            }
            dog++;
        }
        for(int i = people;i < nums.length;i++){
            nums[i] = 0;
        }
    }

    public static void main(String[] args) {
        Solution s = new Solution();
        int[] a = new int[]{0,1,0,3,12};
        s.moveZeroes(a);
        System.out.println(Arrays.toString(a));;
    }
}